﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Commnications
{
    public class EasyResultT2<T> : EasyResultT<T>
    {
        public static EasyResultT2<T> Create<T2>(EasyResultT2<T2> replay)
        {
            var data = new EasyResultT2<T>(false);
            data.Message = replay.Message;
            data.InnerException = replay.InnerException;
            if (data.Data != null)
                data.WrapData = data.Data;
            else
                data.WrapData = replay.WrapData;
            return data;
        }
        public EasyResultT2(bool isSuccess) : base(isSuccess)
        {
        }
        public EasyResultT2(bool isSuccess, T data, Exception ex = null) : base(isSuccess, data)
        {
            this.InnerException = ex;
        }
        public EasyResultT2(Exception ex) : base(false)
        {
            this.InnerException = ex;
        }
        public Exception InnerException { get; set; }
    }
}
